# Should change to your path which contain libgtest.a
GTEST_DIR=../mygtest

# The dirtory which contain Money.h, Money.cpp, MoneyTest and Makefile
SRC_DIR=.

LDFLAGS += -L$(GTEST_DIR)/lib -lgtest -lpthread -lgcov
CXXFLAGS += -c -g -Wall -Wextra -I$(GTEST_DIR)/include -fprofile-arcs -ftest-coverage -fPIC -O0

TARGET = ContainerUnittest
OBJS = Container.o TestContainer.o

CC=g++

.PHONY: clean all test


# All Google Test headers.  Usually you shouldn't change this
# definition.

all: $(TARGET)

$(TARGET) : $(OBJS)
	$(CC)  $^ -o $@ $(LDFLAGS)

Container.o :Container.cpp Container.h
	$(CC) $(CXXFLAGS) $< -o $@

TestContainer.o : TestContainer.cpp
	$(CC) $(CXXFLAGS) $< -o $@

clean:
	rm -f $(TARGET) $(OBJS)
	rm -f *.gcno
	rm -f *.gcda
	rm -f *.html

test: $(TARGET)
	./$(TARGET)
